package com.google.code.contactserv.func.model;

/*
*       Copyright 2007 The semap project development team.
*
*       Licensed under the Apache License, Version 2.0 (the "License");
*       you may not use this file except in compliance with the License.
*       You may obtain a copy of the License at
*
*               http://www.apache.org/licenses/LICENSE-2.0
*
*       Unless required by applicable law or agreed to in writing, software
*       distributed under the License is distributed on an "AS IS" BASIS,
*       WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*       See the License for the specific language governing permissions and
*       limitations under the License.
*
*       Created by ${user} at ${date} ${time}.
*
*       ${description}.
*
*       $Id$
*/

import com.google.code.contactserv.func.model.ConsoleTest;

import java.util.List;
import java.util.ArrayList;

public class ConsoleTestImpl implements ConsoleTest {
    private String name;
    private String arguments;
    private List<String> userInput;
    private List<String> expectedOutput;
    private int exitCode;

    public ConsoleTestImpl(String name){
        this.name = name;
        arguments = "";
        exitCode = 0;
        userInput = new ArrayList<String>();
        expectedOutput = new ArrayList<String>();
    }

    public ConsoleTestImpl setArguments(String arg){
        arguments = arg;
        return this;
    }

    public ConsoleTestImpl setExitCode(int code){
        exitCode = code;
        return this;
    }

    public ConsoleTestImpl addUserInput(String input){
        userInput.add(input);
        return this;
    }

    public ConsoleTestImpl addExpectedOutput(String output){
        expectedOutput.add(output);
        return this;
    }

    public String getArguments() {
        return arguments;
    }

    public List<String> getUserInput() {
        return userInput;
    }

    public List<String> getExpectedOutput() {
        return expectedOutput;
    }

    public int getExpectedExitCode() {
        return exitCode;
    }

    public String getName(){
        return name;
    }
}
